// TimeManager.cpp: implementation of the TimeManager class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "TimeManager.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

TimeManager::TimeManager()
{
	m_time = CTime::GetCurrentTime();
}

TimeManager::~TimeManager()
{
}

TimeManager * TimeManager::m_pInstance = NULL;

TimeManager * TimeManager::Instance()
{
	if (m_pInstance == NULL)
	{
		m_pInstance = new TimeManager;
	}

	return m_pInstance;
}

void TimeManager::DeleteInstance()
{
	if (m_pInstance) delete m_pInstance;

	m_pInstance = NULL;
}

bool TimeManager::IsDateDifferent(const CTime& time) const
{
	return m_time.GetYear() != time.GetYear() || m_time.GetMonth() != time.GetMonth() || m_time.GetDay() != time.GetDay();
}